FROM 192.168.11.18:5000/ubuntu_monit
MAINTAINER Chris Song songchuansheng@91waijiao.com

ADD files/logrotate.d_redis_server /etc/logrotate.d/redis-server
ADD files/redis-server /etc/init.d/redis-server
ADD files/redis.conf /etc/redis/redis.conf

ADD files/check-redis /etc/monit/conf.d/check-redis

ADD files/redis_2.6.16-1_amd64.deb /tmp/redis_2.6.16-1_amd64.deb
RUN dpkg -i /tmp/redis_2.6.16-1_amd64.deb && rm /tmp/redis_2.6.16-1_amd64.deb

RUN adduser --disabled-password redis
RUN mkdir /var/run/redis && chown redis:redis /var/run/redis
RUN mkdir /var/lib/redis && chown redis:redis /var/lib/redis
RUN mkdir /var/log/redis && chown redis:redis /var/log/redis

ADD docker_redis_start.sh /docker_redis_start.sh

#VOLUME ["/var/log/redis", "/var/lib/redis"]

EXPOSE 6379

CMD "/docker_redis_start.sh"

